package com.lm.eec.example;

import com.lm.eec.dto.UserExportDTO;
import org.ttzero.excel.entity.ListSheet;
import org.ttzero.excel.entity.Workbook;

import java.io.IOException;
import java.io.OutputStream;
import java.util.List;

public class UserExcelExport {

    public void export(List<UserExportDTO> list, OutputStream out) throws IOException {
        new Workbook().addSheet(new ListSheet<>(list)).writeTo(out);
    }

    public void muiltExport(List<UserExportDTO> list, OutputStream out) throws IOException {
        new Workbook().addSheet(new ListSheet<UserExportDTO>("客户").setData(list))
                .addSheet(new ListSheet<UserExportDTO>("账单").setData(list))
                .addSheet(new ListSheet<UserExportDTO>("用户关系").setData(list)).writeTo(out);
    }

}